﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Windows.Forms;

namespace MagicEigthBallClient
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnGetQuote_Click(object sender, EventArgs e)
        {
            TcpClient client = new TcpClient();
            client.Connect(IPAddress.Parse(txtConnectTo.Text), 21);
            NetworkStream stream = client.GetStream();

            byte[] data = new byte[1024];
            int recievedDataLength = stream.Read(data, 0, data.Length);
            txtQuote.Text = Encoding.ASCII.GetString(data, 0, recievedDataLength);
        }
    }
}
